package com.baizhi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("cmfz_user")
public class CmfzUser implements Serializable {
    /*CREATE TABLE `cmfz_user` (
            `user_id` int(100) NOT NULL AUTO_INCREMENT,
  `user_telphone` varchar(50) DEFAULT NULL,
  `user_password` varchar(50) DEFAULT NULL,
  `user_image` varchar(200) DEFAULT NULL,
  `user_nickname` varchar(200) DEFAULT NULL,
  `user_name` varchar(20) DEFAULT NULL,
  `user_sex` varchar(20) DEFAULT NULL,
  `user_autograph` varchar(200) DEFAULT NULL COMMENT '个性签名',
            `user_province` varchar(200) DEFAULT NULL,
  `user_city` varchar(200) DEFAULT NULL,
  `guru_id` int(100) DEFAULT NULL,
  `user_status` int(11) DEFAULT NULL,
  `user_create_date` datetime DEFAULT NULL,
    PRIMARY KEY (`user_id`)*/
    @TableId(value = "user_id",type = IdType.AUTO)
    private Integer userId;
    private String userTelphone;
    private String userPassword;
    private String userImage;
    private String userNickname;
    private String userName;
    private String userSex;
    private String userAutograph;
    private String userProvince;
    private String userCity;
    private Integer userStatus;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") //接收日期的格式
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss") //响应json的日期格式
    private Date userCreateDate;
    private Integer guruId;
    @TableField(exist = false)//标明被标注的属性不是数据库表中原生的字段
    private CmfzGuru cmfzGuru;
    @TableField(exist = false)
    private Integer size;//人数

}
